package com.itheima.run;
/*
实现Runnable 第二种写法
匿名内部类

 */
public class Demo02 {


    public static void main(String[] args) {


       new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println("线程1执行到了"+i);
                }
            }
        }).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println("线程2执行到了"+i);
                }
            }
        }).start();


        for (int i = 0; i < 100; i++) {
            System.out.println("main线程执行到了"+i);

        }
    }
}
